<div class="page page-table" data-ng-controller="articleCtr">
    <section class="panel panel-default table-dynamic">
        <div class="panel-heading"><strong><span class="glyphicon glyphicon-th"></span>媒体报道列表</strong></div>

        <div class="table-filters">
            <div class="row">
                <div class="col-sm-4 col-xs-6">
                    <form>
                        <input type="text"
                               placeholder="搜索..."
                               class="form-control"
                               data-ng-model="searchKeywords"
                               data-ng-keyup="search()">
                    </form>
                </div>
                <div class="col-sm-3 col-xs-6 filter-result-info">
                    <span>
                        Showing {{filteredStores.length}}/{{stores.length}} entries
                    </span>
                </div>
                <div class="col-sm-3 col-xs-6">
                    <a type="button" class="btn btn-w-md btn-gap-v btn-success" href="/admin/#/article/article-edit/{{articleType}}/0">新增
                    </a>
                </div>
            </div>
        </div>

        <table class="table table-bordered table-striped table-responsive">
            <thead>
            <tr>
                <th>
                    <div class="th">
                        ID
                        <span class="fa fa-angle-up"
                              data-ng-click=" order('name') "
                              data-ng-class="{active: row == 'id'}"></span>
                        <span class="fa fa-angle-down"
                              data-ng-click=" order('-name') "
                              data-ng-class="{active: row == '-id'}"></span>
                    </div>
                </th>
                <th>
                    <div class="th">
                        文章标题
                        <span class="fa fa-angle-up"
                              data-ng-click=" order('price') "
                              data-ng-class="{active: row == 'title'}"></span>
                        <span class="fa fa-angle-down"
                              data-ng-click=" order('-price') "
                              data-ng-class="{active: row == '-title'}"></span>
                    </div>
                </th>
                <th>
                    <div class="th">
                        创建时间
                        <span class="fa fa-angle-up"
                              data-ng-click=" order('create_at') "
                              data-ng-class="{active: row == 'create_at'}"></span>
                        <span class="fa fa-angle-down"
                              data-ng-click=" order('-price') "
                              data-ng-class="{active: row == '-create_at'}"></span>
                    </div>
                </th>
                <th>
                    <div class="th">
                        状态
                        <span class="fa fa-angle-up"
                              data-ng-click=" order('status') "
                              data-ng-class="{active: row == 'status'}"></span>
                        <span class="fa fa-angle-down"
                              data-ng-click=" order('-sales') "
                              data-ng-class="{active: row == '-status'}"></span>
                    </div>
                </th>
                <th>
                    <div class="th">
                        操作
                        <span class="fa"></span>
                        <span class="fa"></span>
                    </div>
                </th>
            </tr>
            </thead>
            <tbody>
            <tr data-ng-repeat="store in currentPageStores">
                <td>{{store.id}}</td>
                <td>{{store.title}}</td>
                <td>{{store.create_at}}</td>
                <td>{{store.status}}</td>
                <td>
                    <a type="button" class="btn btn-w-md btn-gap-v btn-primary" href="/admin/#/article/article-edit/{{articleType}}/{{store.id}}">编辑
                    </a>
                    <button type="button" class="btn btn-w-md btn-gap-v btn-danger" ng-click="open(store)">删除
                    </button>
                </td>

            </tr>
            </tbody>
        </table>

        <script type="text/ng-template" id="myModalContent.html">
            <div class="modal-header">
                <h3>删除</h3>
            </div>
            <div class="modal-body">
                确定删除 {{article.title}} ?
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" ng-click="ok()">确定</button>
                <button class="btn btn-warning" ng-click="cancel()">取消</button>
            </div>
        </script>

        <footer class="table-footer">
            <div class="row">
                <div class="col-md-6 page-num-info">
                    <span>
                        Show
                        <select data-ng-model="numPerPage"
                                data-ng-options="num for num in numPerPageOpt"
                                data-ng-change="onNumPerPageChange()">
                        </select>
                        entries per page
                    </span>
                </div>
                <div class="col-md-6 text-right pagination-container">
                    <uib-pagination class="pagination-sm"
                                    ng-model="currentPage"
                                    total-items="filteredStores.length"
                                    max-size="4"
                                    ng-change="select(currentPage)"
                                    items-per-page="numPerPage"
                                    rotate="false"
                                    previous-text="&lsaquo;" next-text="&rsaquo;"
                                    boundary-links="true"></uib-pagination>
                </div>
            </div>
        </footer>
    </section>

</div>